package controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import service.MyService;

@Controller
public class Hello {

    @Autowired
    MyService ser;

    @RequestMapping(value = "/success", method = {RequestMethod.GET})
    public String successModel(Model model) {
        model.addAttribute("a", "hello world");
        return "success";
    }

    @ResponseBody
    @RequestMapping("/helloworld")
    public String helloworld() {
        return "hello world";
    }

}